/*
 *  jOTR - Java Off-The-Record Messaging Library
 *  Copyright (C) 2007 Markus Karnik
 *
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 3 of the License, 
 *  or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 *
 *  You should have received a copy of the GNU General Public License along 
 *  with this program; if not, see <http://www.gnu.org/licenses/>.
 *  
 */
package de.karnik.libjotr;

/**
 * The jOTR listener interface defines functions to handle jOTR callbacks. Every jOTR using class has to implement
 * and register this listener interface  to the Jotr object. 
 * 
 * @author Markus Karnik - markus.karnik@my-design.org
 * @version 1.0
 * @since 1.0
 */
public interface JotrListener {
	
	/**
	 *  Invoked when message was received unencrypted.
	 * 
	 * @param context The context of the receiving contact.
	 * @param message The received unencrypted message.
	 */
	public void messageWasReceivedUnencrypted( JotrContext context, String message );
	
	/**
	 * Invoked when the OTR protocol needs to send a Diffie-Hellman commit message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhCommitMessageRequested( JotrContext context );
	/**
	 * Invoked when the OTR protocol needs to send a Diffie-Hellman key message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhKeyMessageRequested( JotrContext context );
	/**
	 * Invoked when the OTR protocol needs to send a Diffie-Hellman reveal signature message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhRevealSignatureMessageRequested( JotrContext context );
	/**
	 * Invoked when the OTR protocol needs to send a Diffie-Hellman signature message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhSignatureMessageRequested( JotrContext context );
	
	/**
	 * Invoked when the OTR protocol needs to send a  query message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void queryMessageRequested( JotrContext context );
	
	/**
	 * Invoked when the OTR protocol received a Diffie-Hellman commit message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhCommitMessageReceived( JotrContext context );
	/**
	 * Invoked when the OTR protocol received a Diffie-Hellman key message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhKeyMessageReceived( JotrContext context );
	/**
	 * Invoked when the OTR protocol received a Diffie-Hellman reveal signature message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhRevealSignatureMessageReceived( JotrContext context );
	/**
	 * Invoked when the OTR protocol received a Diffie-Hellman signature message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void dhSignatureMessageReceived( JotrContext context );
	
	/**
	 * Invoked when the OTR protocol received a error message.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void errorMessageReceived( JotrContext context, String errorMsg );
	
	/**
	 * Invoked when the OTR protocol started the authentication process.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void authentificationStarted( JotrContext context );
	/**
	 * Invoked when the OTR protocol finished the authentication process.
	 * 
	 * @param context Context of the processed contact.
	 */
	public void authentificationFinished( JotrContext context);
	
}
